include_directories(${OPENCV_INCLUDE_DIRS})
aux_source_directory("." SOURCES)

foreach(P ${SOURCES})
  string(REPLACE "./" "" SOURCE ${P})
  string(REPLACE ".c" "" EXEFILE ${SOURCE})
  if(NOT ${SOURCE} MATCHES "^[.](/[.])*[^/]+$")
    add_executable(${EXEFILE} ${SOURCE})
    target_link_libraries(${EXEFILE} ${OPENCV_LIBRARIES} ${OPENCV_LIBRARIES_DEBUG})
  endif()
endforeach()
